import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_member/widget/loading_dialog.dart';

import 'bottom_navigation/botton_navigation_widget.dart';
class LogonStatus extends StatefulWidget {
  @override
  _LogonStatusState createState() => _LogonStatusState();
}

class _LogonStatusState extends State<LogonStatus> {
  //网络状态描述
  String _connectStateDescription;

  StreamSubscription subscription;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) {
      _initParse();
    });
    //监测网络变化
  }

  @override
  void dispose() {
    super.dispose();

  }

  @override
  Widget build(BuildContext context) {
    final height = MediaQuery.of(context).size.height;
    final width = MediaQuery.of(context).size.width;
    return Scaffold(
        body: Stack(
          children: <Widget>[
            Container(
              height: height,
              width: width,
              child: Image.asset(
                'images/login.png',
                fit: BoxFit.fill,
              ),
            ),
            Center(
              child: CLoadingDialog(text: "加載中",),
            )

          ],
        ));
  }

  Future<void> _initParse() async {
    Navigator.of(context).pushAndRemoveUntil(
        new MaterialPageRoute(builder: (context) => BottomNavigationWidget(indexState:0)),
            (route) => route == null);
  }
}
